package com.ruoyi.order.api;

import com.ruoyi.common.core.enums.OrderLogType;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.order.api.domain.ErpSellerOrderLog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "remoteErpOrderLogService", value = ServiceNameConstants.ORDER_SERVICE)
public interface RemoteErpOrderLogService {

    /**
     * 创建订单日志
     * @param orderId
     * @param childOrderId
     * @param orderLogType
     * @param remark
     * @param orderProcessFlagInfo
     * @param erpStatus
     * @return
     */
    @GetMapping("/order/sellerOrderLog/createOrderLog")
    R<Object> createOrderLog(@RequestParam("orderId") Long orderId, @RequestParam("childOrderId") String childOrderId, @RequestParam("orderLogType") OrderLogType orderLogType
            , @RequestParam("remark") String remark, @RequestParam("orderProcessFlagInfo") String orderProcessFlagInfo, @RequestParam("erpStatus") String erpStatus);

    /**
     * 获取到最新的一条日志
     */
    @GetMapping("/order/sellerOrderLog/getStatusIntro/{orderId}")
    ErpSellerOrderLog getStatusIntro(@PathVariable("orderId") Long orderId);

    /**
     * 修改订单日志
     */
    @PutMapping("/order/sellerOrderLog/updateOrderLog")
    R<Void> updateOrderLog(@RequestBody ErpSellerOrderLog log);

}
